#pragma once
#include <iostream>
#include <string>
#include <google/protobuf/service.h>

class MprpcController : public google::protobuf::RpcController
{
public:
    MprpcController();
    virtual void Reset();
    virtual bool Failed() const;
    virtual std::string ErrorText() const;
    virtual void SetFailed(const std::string &reason);

    // 以下是一些目前未实现的功能
    virtual bool IsCanceled() const;
    virtual void NotifyOnCancel(google::protobuf::Closure *callback);
    virtual void StartCancel();
private:
    bool m_failed;         // rpc调用过程中的状态
    std::string m_errText; // 错误信息
};